package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.ISwemediaSensitiveClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class WemeSensitiVesController {
    @Autowired
    private ISwemediaSensitiveClient iSwemediaSensitiveClient;

    //删除敏感词
    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitive(@PathVariable("id") Integer id) {
        return iSwemediaSensitiveClient.deleteSensitive(id);

    }

    //查询列表
    @PostMapping("list")
    public ResponseResult getList(@RequestBody SensitiveDto dto) {
        return iSwemediaSensitiveClient.getList(dto);
    }

    //保存敏感词
    @PostMapping("save")
    public ResponseResult save(@RequestBody WmSensitive wmSensitive) {
        return iSwemediaSensitiveClient.getSave(wmSensitive);
    }

    //修改
    @PostMapping("/update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive) {
        return iSwemediaSensitiveClient.getUpdate(wmSensitive);

    }
}
